#include "stdafx.h"
#include "Row.h"

CRow::CRow(std::string const & rowName)
    :m_rowName(rowName)
{}

CRow::~CRow() {}

std::string CRow::GetRowName() const 
{
    return m_rowName;
}

void CRow::AddCell(std::string const & columnName, std::string const & rowName)
{
    m_cells.insert(std::pair<std::string, std::string>(columnName, rowName));
}

std::string CRow::GetNextRowName(std::string const & columnName) const
{
    std::map<std::string, std::string>::const_iterator it;
    for (it = m_cells.begin(); it != m_cells.end(); ++it)
    {
        if (it->first == columnName)
        {
            return it->second;
        }
    }
    return "";
}